package com.yanqu.road.entity.activity.luckydraw;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_n_lucky_draw_pool")
public class LuckyDrawPoolData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "已抽取次数")
    private ConcurrentHashMap<Integer, Integer> drawTimesMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "今日实物奖励次数")
    private int todayRealRewardTimes;

    @FieldTypeAnnotation(desc = "实物奖励数量重置时间")
    private long resetTime;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public ConcurrentHashMap<Integer, Integer> getDrawTimesMap() {
        return drawTimesMap;
    }

    public void setDrawTimesMap(ConcurrentHashMap<Integer, Integer> drawTimesMap) {
        if (null == drawTimesMap) {
            return;
        }
        if (this.drawTimesMap == null || !this.drawTimesMap.equals(drawTimesMap)) {
            this.drawTimesMap = drawTimesMap;
            setOp(DataStatus.Update);
        }
    }

    public int getTodayRealRewardTimes() {
        return todayRealRewardTimes;
    }

    public void setTodayRealRewardTimes(int todayRealRewardTimes) {
        if (this.todayRealRewardTimes != todayRealRewardTimes) {
            this.todayRealRewardTimes = todayRealRewardTimes;
            setOp(DataStatus.Update);
        }
    }

    public long getResetTime() {
        return resetTime;
    }

    public void setResetTime(long resetTime) {
        if (this.resetTime != resetTime) {
            this.resetTime = resetTime;
            setOp(DataStatus.Update);
        }
    }
}
